{include file="public/head" /}
<body>
{include file="public/menu" /}
<div class="pagelogin">
    <div class="bg" id="bg"></div>
    <div class="bottom">{:confv('copyright')}</div>
    <!--弹出框-->
    <div class="alert">
        <div class="mask"></div>
        <div class="box">
            <div class="subnav" id="subnav" >
                <span class="ac">企业登录</span>
            </div>
            <div class="main">
                <!--登录-->
                <form action="" id="login" class="acform" onSubmit="return false;">
                <div class="user">
                    <input type="text" placeholder="请输入手机号" id="tel2">
                    <input type="hidden" name="lockm" value="" id="lockm">
                </div>
                <div class="password">
                    <input type="password" placeholder="请输入密码" id="password2">
                    <input type="hidden" name="lockcode" value="" id="lockcode">
                </div>
                <div class="password getpiccode">
                    <input type="text" class="recharge-amount amount1" name="code" placeholder="图形验证码" />
                    <img src="{:captcha_src()}" id="code1" alt="captcha" onclick="this.src='{:captcha_src()}?rnd=' + Math.random();" />
                </div>
                <div class="agree"></div>
                <input type="submit" value="登录" onclick="checkInfo2()">
                <div class="err" id="err2"></div>
                </form>

            </div>
        </div>
    </div>
</div>
</body>
{include file="public/load_bottom" /}
{load href="__static__/hry/js/Base64.js" /}
<script>

    $(function () {
                setBg()
                var nav = $('#subnav').find('span')
                var form = $('.main form')
                nav.click(function () {
                    var index = $(this).index()
                    if(index==1){
                        $('#fgt').hide()
                    }else{
                        $('#fgt').show()
                    }
                    $(this).addClass('ac').siblings().removeClass('ac')
                    form.eq(index).addClass('acform').siblings().removeClass('acform')
                })
            })
    function setBg() {
        var h = $(window).height()
        $('#bg').css('height',h-98-130)
    }


    function checkInfo2() {
        var tel = $('#tel2')
        var password1 = $('#password2')
        var err = $('#err2')
        var agree = $('#agress')
        if(tel.val()==''){
            err.text('请输入手机号码！')
            err.fadeIn(300)
            setTimeout(function(){
                err.fadeOut(300)
            },1000)
            tel.focus()
            return false
        }
        else if(password1.val()==''){
            err.text('请输入密码！')
            err.fadeIn(300)
            setTimeout(function(){
                err.fadeOut(300)
            },1000)
            password1.focus()
            return false
        }
        var lockm = Base64.encode(tel.val())
        var lockcode = Base64.encode(password1.val())
        $("#lockm").val(lockm)
        $("#lockcode").val(lockcode)
        var fromData = $('#login').serialize();
        $.ajax({
            url:"{:url('Companylogin/loginin')}",
            type:"POST",
            dataType:"JSON",
            data:fromData,
            success:function(msg){
                if(msg.status == 1){
                    err.text(msg.info);
                    err.fadeIn(300)
                    setTimeout(function(){
                        err.fadeOut(300)
                    },1000)
                    window.location = msg.url;
                }else{
                    err.text(msg.info);
                    err.fadeIn(300)
                    setTimeout(function(){
                        err.fadeOut(300)
                    },1000)
                }
            }

        })
    }
</script>
<style>
    .layermchild{ -webkit-overflow-scrolling: touch;}
</style>
</html>